package com.markerhub.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.markerhub.entity.SysShop;
import com.markerhub.mapper.SysShopMapper;
import com.markerhub.service.SysShopService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author jsx on 2023/2/2
 **/
@Service
public class SysShopServiceImpl extends ServiceImpl<SysShopMapper, SysShop> implements SysShopService {

    @Autowired
    SysShopMapper sysShopMapper;

    @Override
    public Page<SysShop> getList(Page page,String name) {
        return sysShopMapper.selectList(page,name);
    }

    @Override
    public SysShop getShopByName(String name) {
        QueryWrapper<SysShop> wrapper = new QueryWrapper<>();
        wrapper.eq("name",name);
        return sysShopMapper.selectOne(wrapper);
    }
}
